import random
newdic={}
pool=[random.randint(1,20) for i in range(0,20)]
poolset=set(pool)
dic={i:pool.count(i) for i in poolset}
#print(dic)
x=sorted(dic.values())
# print(x)
for k,v in dic.items():
    if x[-1]==v:
        newdic[k]=v
    elif x[-2]==v:
        newdic[k] = v
    elif x[-3]==v:
        newdic[k] = v
print(newdic)


# 效率有点问题
